import java.util.Timer;
import java.util.TimerTask;

public class TestDemo {
    public static void main(String[] args) {
        Timer timer = new Timer();
        System.out.println("程序启动!");
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("定时器3");
            }
        },3000);
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("定时器2");
            }
        },2000);
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("定时器1");
            }
        },1000);
    }
}
